import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter);


const router = new VueRouter({
    routes: [
        {
            path: '/main',
            component: require('../components/main.vue'),
            children: [
                {
                    path: '/main/active',
                    component: require('../components/active.vue'),
                }, {
                    path: '/main/community',
                    component: require('../components/community.vue')
                }, {
                    path: '/main/mall',
                    component: require('../components/mall.vue')
                }
            ]
        }, {
            path: '/community/:id',
            component: require('../components/community-detail.vue')
        }, {
            path: '/active/:id',
            component: require('../components/active-detail.vue')
        }, {
            path: '/message',
            component: require('../components/message.vue')
        }, {
            path: '/test',
            component: require('../components/test.vue')
        }, {
            path: '*', redirect: '/main/community'
        }
    ]
});


export default router;
